<%@ page language="java" pageEncoding="utf-8" %>
<%@ page import="com.yungu.swift.api.wxapi.pojo.SNSUserInfo ,java.lang.*" %>
<%
    SNSUserInfo user = (SNSUserInfo) request.getSession().getAttribute("snsUserInfo");
    if (user != null) {
        session.setAttribute("openId", user.getOpenId());
        session.setAttribute("nickName", user.getNickname());
        session.setAttribute("sex", user.getSex());
        session.setAttribute("image", user.getHeadImgUrl());
    }
    session.setAttribute("image", "");
    String path = request.getContextPath();
    session.setAttribute("path", path);
%>
<!DOCTYPE html>
<html>
<head>
    <%@include file="../common/base.jsp" %>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1"/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
    <meta http-equiv="expires" content="0">
    <%--<title>${appName}</title>--%>
    <title>${appName}</title>
    <link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.min.css">
    <!--城市选择css-->
    <link rel="stylesheet" href="${base}/plugin/cityselect/css/LArea.min.css">
    <!--单列选择-->
    <link rel="stylesheet" href="${base}/plugin/iosselect-master/src/iosSelect.css">

    <link rel="stylesheet" type="text/css" href="${base}/plugin/citysearch/citysearch.css?version=${version}">
    <!---->
    <link rel="stylesheet" type="text/css" href="${base}/css/global.css?version=${version}">
    <link rel="stylesheet" type="text/css" href="${base}/css/index.css?version=${version}">
    <style type="text/css">
        .input {
            -webkit-appearance: none;
            -moz-appearance: none;
            -o-appearance: none;
            appearance: none;
            background-color: #ffffff;
        }

        #historyBox {
            position: fixed;
            top: 50px;
            left: 0;
        }

        /*.layui-layer {*/
        /*-webkit-border-radius: 0px !important;*/
        /*-moz-border-radius: 0px !important;*/
        /*border-radius: 0px !important;*/
        /*}*/

        .closeExtraDiv {
            position: fixed;
            text-align: center;
        }

        .layui-layer-msg {
            background-color: #585858 !important;
        }

        body {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            min-height: 600px;
        }

        .layui-layer {
            overflow: hidden;
        }

        .layui-layer-content {
            position: relative;
            border-bottom-left-radius: 10px;
            border-bottom-right-radius: 10px;
            overflow: hidden;
        }

        .closeExtraDiv {
            /*display: none;*/
        }

        .layui-layer-title {
            height: 30px;
            line-height: 30px;
        }

    </style>
</head>
<body>
<input type="hidden" value="" id="inputId">
<input type="hidden" value="0" id="valueTo">
<input type="hidden" value="" id="curLocation">
<input type="hidden" value="${sessionScope.passengerUuid}" id="passengerUuid">
<div id="container" class="hide">

</div>
<div id="searchBox" class="container-fluid">

</div>
<div id="mask"></div>
<div id="historyBox" class=""></div>
<div id="containerBox" class="container-fluid">
    <%@include file="./include/header.jsp" %>
    <%--<div class="header clearfix text-center">--%>
    <%--<div class="header-phone">--%>
    <%--<div class="user-face-icon">--%>
    <%--<img class="img" src="${base}/images/man.png">--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="header-tab">--%>
    <%--<div class="wrapper wrapper03" id="wrapper03">--%>
    <%--<div class="scroller">--%>
    <%--<ul class="clearfix">--%>
    <%--<li><a href="${base}/yue/index">专车</a></li>--%>
    <%--&lt;%&ndash;<li><a href="javascript:void(0)">快车</a></li>&ndash;%&gt;--%>
    <%--<li><a href="javascript:void(0)">接送机</a></li>--%>
    <%--<li><a href="${base}/yue/index_taxi">出租车</a></li>--%>
    <%--</ul>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--&lt;%&ndash;<span class="title">专车</span>&ndash;%&gt;--%>
    <%--</div>--%>
    <p class="text-center tips">您好，您现在想去哪儿？</p>
    <div class="info-container">
        <div style="text-align: center;">
            <span id="setoutTime" class="text-center setoutTime">
                <img class="img timeshow" src="${base}/images/time.png">
                <span id="timeshow" class="timeshow">现在</span>
            </span>
        </div>

        <ul class="addr-inputs beyhide">
            <li class="li qidian">
                <img class="img" src="${base}/images/qidian.png">
                <%--<input id="qidian_input" class="input qidian-input" type="text" value="" placeholder="你从哪上车">--%>
                <span class="input qidian-input" id="qidian_input" style="display: inline-block;">您从哪上车</span>
                <%--<select data-click="false" class="input qidian-input select-position" name=""--%>
                <%--id="qidian_input"></select>--%>
            </li>
            <li class="li zhongdian">
                <img class="img" src="${base}/images/zhongdian.png">
                <%--<input id="zhongdian_input" class="input" type="text" placeholder="你要去哪儿" data-click="true">--%>
                <span id="zhongdian_input" class="input" style="display: inline-block;">您要去哪儿</span>
                <%--<select data-click="true" class="input select-position" name="" id="zhongdian_input">--%>
                <%--<option selected disabled value="">你要去哪儿</option>--%>
                <%--</select>--%>
            </li>
        </ul>
        <div class="row takeman hide">
            <p id="changeCustomer" class="p">
                <img src="${base}/images/order_icon_user@3x.png">
                <span id="changeCustomerSpan">换乘车人</span>
            </p>
<%--            <p id="selectCarType" class="col-xs-6 p">--%>
<%--                <img src="${base}/images/Shape.png">--%>
<%--                <span id="carTypeText" data-id="" data-value="">选择车型</span>--%>
<%--            </p>--%>
        </div>
        <div class="costBox hide" style="text-align: center;">
            <div style="display: inline-block;">
                <p class="text-center cost fare-info">约<span id="moneyText" class="money">0</span>元</p>
                <p class="text-center sub" style="font-size: 14px;display: none;" id="actPaid">券可抵扣 <span>0</span>元</p>
            </div>
        </div>
    </div>
    <div class="btn-call btn-call-disabled" style="text-decoration:none;">呼叫快车</div>
</div>
<%--侧边导航--%>
<div class="nav_mask"></div>
<div class="l-left-nav">
    <div class="user-info">
        <div class="user-face"><img src="${image}" class="" alt=""></div>
        <div class="user-name"> ${nickName} </div>
        <div class="user-mobile"></div>
    </div>
    <div class="Rectangle-16-Copy-6"></div>
    <div class="nav-list">
        <a href="${base}/yue/order_list" class="trip">我的行程</a>
        <a href="${base}/yue/couponlist" class="couponlist">优惠券</a>
        <a href="javascript:void(0)" class="exit" id="exit">退出</a>
    </div>
</div>

<div class="l-footer" style="position: absolute;">
    <%@include file="footer.jsp" %>
</div>

</body>
<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/plugin/layer-v3.0.3/layer.js"></script>

<script type="text/javascript"
        src="https://webapi.amap.com/maps?v=1.3&key=55897440ff54932c599cc73b9b4baf1c&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Driving,AMap.CitySearch,AMap.Geolocation"></script>
<script src="${base}/plugin/cityselect/js/LAreaData1.js?version=${version}" type="text/javascript"></script>
<script src="${base}/plugin/cityselect/js/LArea.js?version=${version}" type="text/javascript"></script>

<script src="${base}/js/carType.js"></script>
<script src="${base}/plugin/iosselect-master/src/iscroll.js"></script>
<script src="${base}/plugin/iosselect-master/src/iosSelect.js"></script>
<script src="${base}/plugin/iosselect-master/flexible.js"></script>
<script src="${base}/plugin/iosselect-master/navbarscroll.js"></script>

<script type="text/javascript" src="${base}/js/localStorageOpt.js?version=${version}"></script>
<script type="text/javascript" src="${base}/js/constant.js?version=${version}"></script>
<script type="text/javascript" src="${base}/js/position.js?version=${version}"></script>
<script type="text/javascript" src="${base}/js/utils.js?version=${version}"></script>

<script type="text/javascript" src="${base}/js/search.js?version=${version}"></script>

<script type="text/javascript" src="${base}/plugin/citysearch/citysearch.js?version=${version}"></script>
<script type="text/javascript">
    <%--var yun=new yueajax( "${openId}",'validateOpenId');--%>
    var yun = new yueajax("${openId}");
    (function () {
        setLocalStorage('ifBindWxUser', "false")
        setLocalStorage('isH5', "true")
        delLocalStorage("yueuser")
        var us = getLocalStorage("yueuserH5", "object");
        if (!!us) {
            setLocalStorage('ifBindWxUser', "true")
            $(".user-face").find('img').attr("src", us.face || "${base}/images/man.png");
            $(".user-name").html(us.nickname || "未填写");
            $(".user-mobile").html((us.mobile).replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'));

            yun.ajax_md5(
                {token: us.token},
                "/api/v1/passenger/token/order/status",
                function (data) {
                    var d = data.data;
                    if (!d) {
                        setLocalStorage('ifBindWxUser', false)
                        delLocalStorage('yueuserH5')
                        changeUrl("index");
                        return;
                    }
                    if (d.status != 0) {
                        setLocalStorage('subStatus', d.subStatus);
                        changeUrl(d.subStatus, d.orderUuid + '&status=' + d.status);
                    }
                },
                function (data) {
                    setLocalStorage('ifBindWxUser', false)
                    delLocalStorage('yueuserH5')
                    changeUrl("index");
                }
            )
        }
    })()
    delLocalStorage('actualMobile');//删除换乘人电话号码
    var $document = $(document);
    // 初始化起点定位数据
    initStartInputData();
    // 浏览器回退监听
    pushHistory('${appName}', '#');
    window.addEventListener("popstate", function (e) {
//            cancelInputOrBack();
        letShow();
    }, false);
    // 初始化--出发时间选择
    var area1 = new LArea();
    area1.init({
        'trigger': '#timeshow', //触发选择控件的文本框，同时选择完毕后name属性输出到该位置
        'valueTo': '#valueTo', //选择完毕后id属性输出到该位置
        'keys': {
            id: 'id',
            name: 'name'
        }, //绑定数据源相关字段id对应valueTo的value属性输出name对应trigger的value属性输出
        'type': 1, //数据源类型
        'data': LAreaData, //数据源
        clickFinish: function () {
            calculate(yun);
        }
    });
    //侧边栏
    $document.on('touchend', '.user-face-icon', function () {
        var isBind = getLocalStorage('ifBindWxUser', 'string');
        if (isBind == 'false' || isBind == null) {
            setTimeout(function () {
                layer.open({
                    type: 2,
                    title: "验证手机号，方便司机联系您",
                    area: ['92%', '235px'], //宽高,
                    shadeClose: true,
                    content: '/yue/login'
                });
            }, 60)


        } else if (isBind == 'true') {
            $('.nav_mask').show();
            $('.l-left-nav').show()
        }
    });

    $document.on('touchend', '.nav_mask', function () {
        $('.nav_mask').hide();
        $('.l-left-nav').hide()
    });
    //退出
    $document.on('touchend', '#exit', function () {
        yun.ajax_md5(
            {openId: yun.openId},
            '${base}/wx/passenger/unBind',
            function (data) {
                // delLocalStorage('ifBindWxUser');
                // delLocalStorage('yueuser');
                // delLocalStorage('validateOpenId');
                // delLocalStorage('subStatus');
                // delLocalStorage('hasOrder');
                // delLocalStorage('comment');
                // delLocalStorage('actualMobile');
                // delLocalStorage('Estimate');
                localStorage.clear();
                window.location.replace('/yue/h5/index')
               // window.location.reload();
            },
            function (data) {
                // delLocalStorage('ifBindWxUser');
                // delLocalStorage('yueuser');
                // delLocalStorage('validateOpenId');
                // delLocalStorage('subStatus');
                // delLocalStorage('hasOrder');
                // delLocalStorage('comment');
                // delLocalStorage('actualMobile');
                // delLocalStorage('Estimate');
                localStorage.clear();
                window.location.replace('/yue/h5/index')
                // window.location.reload();
                // layer.msg(data.msg)
            }
        )
    });

    //侧边栏 END

    // 点击呼叫专车
    $document.on('touchend', '.btn-call-abled', function () {
        var isBind = getLocalStorage('ifBindWxUser', 'string');
        if (isBind == 'true') {
            isBind = true;
        } else if (isBind == 'false') {
            isBind = false;
        }
        var $self = $(this);
        if (!isBind) {
            setTimeout(function () {
                // $self.data('isclick',false)
                layer.open({
                    type: 2,
                    title: "验证手机号，方便司机联系您",
                    area: ['92%', '235px'], //宽高,
                    shadeClose: true,
                    content: '${base}/yue/login'
                });
            }, 60)
        } else {
            var hasOrder = +getLocalStorage('hasOrder', 'string');
            var subStatus = getLocalStorage('subStatus', 'string');
            //查找是否有进行中的订单，如果有就跳转页面到进行中的订单
            if (hasOrder != 0) {
//                changeUrl(subStatus);
            } else {
                var url = "${base}/api/v1/passenger/token/specialOrder/addRealtime";
                //起始点距离
                var routeInfo = getLocalStorage('routeInfo', 'object');
                // 起点信息
                var startLocation = getLocalStorage(START_LOCATION_INFO, 'object');
                // 终点信息
                var endLocation = getLocalStorage(END_LOCATION_INFO, 'object');

                // 预估价信息
                var Estimate = getLocalStorage(estimate, 'object');

                var departTime = getTimeStemp();//预约单有的预约时间
                var actualMobile = "";
                if ($('#changeCustomerSpan').text().startsWith("尾号")) {
                    actualMobile = getLocalStorage('actualMobile', 'string');//实际乘车人电话，只有写了换乘车人才有值
                }
                var $trigger = $('#carTypeText');
                var carId = $trigger.data("id");
                // 判断是否在预约时间内
                var isDepartTime = !departTime ? false : (departTime - 1000 * 60 * 30) >= (new Date().getTime());
                window.$location ? null : window.$location = {lat: 0, lng: 0}
                var dataBody = {
                    "passengerLat": window.$location.lat,
                    "passengerLng": window.$location.lng,
                    'planDuration': Math.ceil(routeInfo.time / 60),// 预估时长
                    "source": 1,// 来源
                    "typeEnt": 1,// 订单类型（个人/企业）：1 个人；2 企业
                    "typeModule": 4,// 订单模块类型（1：出租车，2：专车，3：拼车，4：快车，5：货的，6：骑手，7：搬家）
                    "typeTripNew": 1,//订单行程类型（1：用车，2：日租，3：半日租，4：送机，5：接机）
                    "typeTimeNew": !departTime ? 1 : 2,// 订单时效类型（1：实时，2：预约）
                    "prepayType": 2,// 预支付方式（1企业支付，2个人支付）
                    "typeSelf": actualMobile == "" ? 1 : 2,//订单类型（本人/代客）：1 本人；2 代客
                    "originCity": startLocation.city,
                    "originAddress": startLocation.name,
                    "originDetailAddress": startLocation.district ? startLocation.district + startLocation.address : startLocation.province + startLocation.city + startLocation.name,
                    "destCity": endLocation.city,
                    "destAddress": endLocation.name,
                    "destDetailAddress": endLocation.district ? endLocation.district + endLocation.address : endLocation.province + endLocation.city + endLocation.name,
                    "originAreaCode": startLocation.adcode,
                    "destAreaCode": endLocation.adcode,
                    "originLng": startLocation.location.lng,
                    "originLat": startLocation.location.lat,
                    "destLng": endLocation.location.lng,
                    "destLat": endLocation.location.lat,
                    "planTrip": routeInfo.distance / 1000,//预估里程(公里)  (单位是米/m)  取时间 routeInfo.time (单位是秒/s),
                    // "planDuration": 5,
                    "deparTime": departTime ? departTime : '',//出发时间
                    "carLevelUuid": carId,
                    'diu': window.diu,// 设备唯一标识
                    'passengerName': '',// 实际乘车人
                    'passengerMobile': actualMobile,
                    "orderSource": 2,
                    "typeTime": departTime ? 2 : 1,
                    "typeTrip": 1
                }
                $self.removeClass('btn-call-abled')
                $self.addClass('btn-call-disabled')
                yun.ajax_md52(dataBody
                    , '${base}/api/v2/passenger/order/create'
                    , function (data) {
                        // $self.data('isclick',false)
                        layer.msg('下单成功，正在跳转页面')
                        changeUrl(data.data.subStatus, data.data.uuid);
                    }
                    , function (error) {
                        // $self.data('isclick',false)
                        // $self.addCall('btn-call-abled')
                        $self.removeClass('btn-call-disabled')
                        delLocalStorage(inOrder);
                        layer.msg(error.msg);
                    }
                    , 'POST')
            }
        }
    });

    // 起点输入touchend
    $document.on('touchend', '#qidian_input', function (event) {
        event.stopPropagation();
        // 禁止弹出软键盘
        document.activeElement.blur();
        var city = defaultCity
        var startloca = getLocalStorage(START_LOCATION_INFO, 'object')
        if ($('#qidian_input').html() != '您从哪上车') {
            city = startloca.city || defaultCity
        }
        setLocalStorage('city', city)

        setInputValue('addr/transfer', 'qidian_input', START_LOCATION_INFO);
    });

    // 终点输入
    $document.on('touchend', '#zhongdian_input', function (event) {
        event.stopPropagation();
        // 禁止弹出软键盘
        document.activeElement.blur();

        var city = defaultCity
        var endloca = getLocalStorage(END_LOCATION_INFO, 'object')
        var startloca = getLocalStorage(START_LOCATION_INFO, 'object')
        if ($('#zhongdian_input').html() != '您要去哪儿') {
            city = endloca.city || startloca.city || defaultCity
        } else {
            city = startloca.city || defaultCity
        }
        setLocalStorage('city', city)

        setInputValue('end', 'zhongdian_input', END_LOCATION_INFO);
    });

    // 输入换乘客人联系方式
    $document.on('touchend', '#changeCustomer', function () {
        layer.open({
            type: 2,
            title: "   ",
            //skin: 'layui-layer-rim', //加上边框
            area: ['80%', '260px'], //宽高,
            shadeClose: false,
            content: '${base}/yue/inputPhone',
//            closeBtn: false
        });
//        addExtraCloseBtn();
    });

    // 自定义关闭按钮
    $document.on('touchend', '#closeExtra', function (event) {
        layer.closeAll();
        $(this).parent('.closeExtraDiv').remove();
    });

    // 选择车型类型
    $document.on('touchend', '#selectCarType', function () {
        var $this = $(this);
        var $span = $this.find('span').eq(0);
        var carTypeId = $span.data('id');
        var carTypeData = getLocalStorage('carTypeData', 'object');
        var carTypeList = $.map(carTypeData, function (elem, index) {
            var obj = {
                id: elem.uuid,
                value: elem.levelName
            }
            return obj;
        });
        var bankSelect = new IosSelect(1, [carTypeList], {
            container: '.container',
            title: '选择车型',
            itemHeight: 50,
            itemShowCount: 3,
            oneLevelId: carTypeId,
            callback: function (selectOneObj) {
                valuation('${sessionScope.passengerUuid}', selectOneObj.id, yun);
                $span.text(selectOneObj.value);
                $span.data('id', selectOneObj.id);
                $span.data('value', selectOneObj.value);
            }
        });
    });

    // 取消
    $document.on('touchend', "#cancelBtn", function (event) {
        $('.amap-sug-result').remove();
        // 如果是起点输入取消时，需要设置定位信息
//        var currentL = getLocalStorage(START_LOCATION_INFO, 'object');
//        setName(currentL.name, currentL.adcode);
        $('#historyBox').addClass('hide').html('');
        $('#searchBox').html('');
        $('#containerBox').removeClass('hide');
        $('.l-footer').removeClass('hide');
        letShow();
        $('.kucity').hide();
        $('.citysel').remove()
    });

    // 起始点搜索input获取焦点监听
    $document.on('focus', "#tipinput", function (event) {
        $('.searchResultList').addClass('hide');
        $('.kucity').hide();
        appendHistory();
    });

    // 起始点搜索input输入监听
    $document.on('keyup input propertychange', "#tipinput", function (event) {

        var $this = $(this),
            keyword = $this.val();

        if (keyword.length > 0) {
            $('#input_delete').removeClass('hide');
            autoComplete(keyword);
        } else {
            $('#input_delete').addClass('hide');
        }
        $('#historyBox').addClass('hide').html('');
    });

    // 历史记录点击
    var toucheFlag = false;
    $document.on('touchstart touchmove touchend', '.history-item', function (event) {
        event.stopPropagation();
        switch (event.type) {
            case 'touchstart':
                toucheFlag = false;
                break;
            case 'touchmove':
                toucheFlag = true;
                break;
            case 'touchend':
                if (!toucheFlag) {
                    var $this = $(this);
                    var $div = $this.clone();
                    $div.find(':nth-child(n)').remove();
                    var name = $div.html();
                    var data = $this.data('item');
                    setName(name, data);
                    letShow();
                    search(data);
                    calculate(yun);
                }
                toucheFlag = false;
                break;
        }
    });

    //    预估费用详情
    $document.on('touchend', '.fare-info', function () {
        layer.open({
            type: 2,
            title: false,
            closeBtn: false,
            shadeClose: false,
            //skin: 'layui-layer-rim', //加上边框
            area: ['100%', '100%'], //宽高,
            shadeClose: true,
            anim: 'up',
            content: '${base}/yue/fareInfo?estimate=Estimate',
            offset: 'lb',
            success: function (index) {
                index.addClass('notradius')
            }
        });
    });

    function setInputValue(from, to, curLocation) {
        $('#containerBox').addClass('hide');
        $('.l-footer').addClass('hide');
        $('#searchBox').removeClass('hide');
        $('#searchBox').load('${base}/yue/' + from);
        $('#curLocation').val(curLocation);
        $('#inputId').val(to);
    }

    function addExtraCloseBtn() {
        var $layer = $('.layui-layer'),
            height = $layer.css('height'),
            top = $layer.css('top'),
            width = $layer.css('width'),
            left = $layer.css('left'),
            zIndex = $layer.css('z-index');

        var $close = $('<div class="closeExtraDiv"><a id="closeExtra" href="javascript:void(0);" style="display: inline-block;"><img src="/images/closeImg.png" /></a></div>');
        var $close = $('<div class="closeExtraDiv">X</div>');

//        top = +(top.substring(0, top.indexOf('px')));
//        height = +(height.substring(0, height.indexOf('px')));
        top = +0;
        height = +0;

        $close.animate({
            'z-index': zIndex,
            'width': width,
            'height': '35px',
            'top': (top + height) + 'px',
            'left': left
        }).find('img').css('height', '80px');

        $close.insertAfter($layer);
    }

    function getCarTypeFromService() {
        var carTypeData = [];
        yun.ajax_md5({}, "${base}/api/v1/passenger/carModelsLevel/list", function (data) {
            console.log(data);
            var data = data.data;
            carTypeData = data;
            setFirstCarType(carTypeData);
            setLocalStorage('carTypeData', carTypeData);
        }, function (data) {
            layer.msg(data.msg);
        })
    }

    // getCarTypeFromService();

    function setFirstCarType(data) {
        //默认先用舒适型来预估
        var first = data[0];
        var $trigger = $('#carTypeText');
        $trigger.data('id', first.uuid);
        $trigger.data('value', first.levelName);
        $trigger.text(first.levelName);
        <%--debugger--%>
        <%--valuation('${sessionScope.passengerUuid}',first.uuid);--%>
    }


    function appendHistory() {
        var divHtml = "<div class='amap-sug-result'>";
        var searchHistory = getLocalStorage('searchHistory', 'object');
        if (searchHistory) {
            var len = searchHistory.length;
            if (len > 0) {
                for (var i = 0; i < len; i++) {
                    var item = searchHistory[i];
                    var dataStr = JSON.stringify(item);
                    divHtml += "<div data-item='" + dataStr + "' class='auto-item history-item'" +
                        " id='amap-sug" + i + "'>" + item.name + "<span class='auto-item-span'>" +
                        (item.district || (item.province + item.city + item.name)) + "</span></div>";
                }
                divHtml += "</div>";
                $('#historyBox').removeClass('hide').html(divHtml);
            } else {
                $('#historyBox').addClass('hide').html('');
            }
        }
    }

    function initStartInputData() {
        return;
        var $qidian = $('#qidian_input');
        var currentLocation = getLocalStorage(START_LOCATION_INFO, "object");
//            加入判断此时是否已经存在当前用户定位信息
        if (!currentLocation) {
            setTimeout(function () {
                initStartInputData()
            }, 30);
        } else {
            var location = currentLocation.location;
            $qidian.html(currentLocation.name);
            setLocalStorage('city', currentLocation.city);
            $qidian.data({
                name: currentLocation.name
            })
        }

    }
</script>
</html>
